//导入模块
const express = require('express');
const db = require('../uilit/mysql')


//创建路由
const myRouter = express.Router();

//接口编写
myRouter.post('/submit', (req, res) => {
  const sql = `UPDATE seeker SET s_password='${req.body.password}' WHERE s_tel='${req.body.telphone}'`
  db.query(sql, (err, data) => {
    if (err) {
      console.log(err)
    } else {
      res.send({ code: '200', msg: '修改成功' })
    }
  })
})


//
myRouter.post('/search',(req,res)=>{
  //job表
  const sql=` SELECT * FROM job ORDER BY j_date DESC LIMIT 0,6;`;
  db.query(sql,(err,data)=>{
    if(err){
      console.log(err)
    }else{
      res.send({msg:'查询成功',data:data})
    }
  })

})








//导出
module.exports = myRouter;